package com.gylang.im.core.constant;

/**
 * @author gylang,
 * date 2020/5/10,
 * @version 1.0
 */
public interface CacheConstants {

    /**
     * 缓存用户信息key
     */
    String TOKEN_KEY = "auth_info:%s";


    /**
     * 缓存授权角色信息key
     */
    String USER_AUTH_KEY = "user_auth:uid:%s";
    /**
     * 缓存授权角色信息key
     */
    long USER_AUTH_EXPIRE = 6 * 60 * 60;

    /**
     * 获取授权角色信息时读取数据库的锁
     */
    String USER_AUTH_LOCK_KEY = "user_auth_lock:uid:%s";

    /**
     * access_token过期时间
     */
    long ACCESS_TOKEN_EXPIRE = 12 * 60 * 60 * 1000;

    /**
     * refresh_token过期时间
     */
    long REFRESH_TOKEN_EXPIRE = 7 * 24 * 60 * 60 * 1000;



    String SCRIPT_CHANNEL_KEY = "script_channel:channel_id:%s";

    String SCRIPT_CLIENT_KEY = "script_client:client_id:%s";


    String DY_WEB_PAGE_TEMPLATE_KEY = "dy_web_page:channel_id:%s:client_id:%s";

    String DY_WEB_PAGE_TEMPLATE_MODIFY_KEY = "dy_web_page:modify:channel_id:%s:client_id:%s";
    /**
     * %s -> username
     */
    String USE_EMAIL_RESET_PASSWORD = "USER_EMAIL_REESET_PASSWORD_%s";
    /**
     * 15分钟有效
     */
    long USE_EMAIL_RESET_PASSWORD_EXPIRE = 15*60;

}
